package kr.pe.kim21.iphonedevplugin.ui.wizard;

import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.ui.newui.UIMessages;
import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard;
import org.eclipse.cdt.ui.wizards.CProjectWizard;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;

public class IPhoneDevPluginWizard extends CDTCommonProjectWizard {
	
	private IPhoneDevMainWizardPage fMainPage;
	
	public IPhoneDevPluginWizard(){
		super("iPhone Dev New Wizard", "New Wizard for iPhone Dev");
		
	}
	@Override
	protected IProject continueCreation(IProject prj) {
		if (continueCreationMonitor == null) {
			continueCreationMonitor = new NullProgressMonitor();
		}
		
		try {
			continueCreationMonitor.beginTask(UIMessages.getString("CProjectWizard.0"), 1); //$NON-NLS-1$
			CProjectNature.addCNature(prj, new SubProgressMonitor(continueCreationMonitor, 1));
		} catch (CoreException e) {}
		finally {continueCreationMonitor.done();}
		return prj;
	}

	@Override
	public String[] getNatures() {
		return new String[] { CProjectNature.C_NATURE_ID };
	}
	
	@Override
	public void addPages() {
		fMainPage = new IPhoneDevMainWizardPage("iPhone Dev New Wizard");
		fMainPage.setTitle("iPhone Dev New Wizard");
		fMainPage.setDescription("iPhone Dev New Wizard");
		this.addPage(fMainPage);
	}
	
	
}
